using System.Collections.Generic;
namespace pd2_server_sdk.server
{
    public static class ControllerManager
    {
        private static readonly List<object> _controllers = new List<object>();
        public static IReadOnlyList<object> Controllers => _controllers;

        public static void Register(object controller)
        {
            _controllers.Add(controller);
        }

        public static T GetController<T>() where T : class
        {
            return _controllers.Find(c => c is T) as T;
        }
    }
}